package com.gui.profile.web;

import com.gui.profile.service.OomService;
import com.gui.profile.service.SlowApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/profile")
@RestController
public class ProfileController {

    @Autowired
    private OomService oomService;

    @Autowired
    private SlowApiService slowApiService;

    @RequestMapping(value = "/oom", method = RequestMethod.GET)
    public String test(){
        oomService.oom();
        return "success";
    }

    @RequestMapping(value = "/slow", method = RequestMethod.GET)
    public String slowApi(){
        slowApiService.slow();
        return "success";
    }
}
